package com.example.mobile2021606129ly0330;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity_num extends AppCompatActivity {

    private EditText edNum;
    private Button butNumRes;
    private TextView textNumRes;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_num);
        initView();
        butNumRes.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                int a=Integer.parseInt(edNum.getText().toString());
                edNum.setText(edNum.getText().length());
                edNum.setText(edNum.getText());
                int d=0;
                while (a>0){
                    d=a%10;
                    a=a/10;
                }
                edNum.setText('a');


            }
        });
    }

    private void initView() {
        edNum = (EditText) findViewById(R.id.ed_num);
        butNumRes = (Button) findViewById(R.id.but_num_res);
        textNumRes = (TextView) findViewById(R.id.text_num_res);
    }
}